package com.Zhengxin.smarthome.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseOpenHelper extends SQLiteOpenHelper{
	
	private static final int VERSION=1;
	public static final String alarmTable = "user";
	public DatabaseOpenHelper(Context context) {
		super(context, "AlarmTable", null, VERSION);
		// TODO Auto-generated constructor stub
	}
//	
//	public DatabaseHelper(Context context,int version){
//		this(context, name, null, version);
//	}
//	
//	public DatabaseHelper(Context context,String name){
//		this(context, name, VERSION );
//	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		System.out.println("create a Database");
		db.execSQL("create table "+alarmTable+"(ID INTEGER PRIMARY KEY AUTOINCREMENT,Time varchar,Week varchar,Equipment varchar)");
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		
	}

}
